import Vue from 'vue'
import Vuex from 'vuex'
import moduleA from './modules/index'
import user from './user/index'
import createPersistedState from "vuex-persistedstate"
import { Message} from 'element-ui';
/**
  * 提示函数
  * 禁止点击蒙层、显示一秒后关闭
  */
const tip = msg => {
   Message(msg);
}
Vue.use(Vuex);


console.log(user)
export default new Vuex.Store({
  modules: {
    moduleA,
    user
  },
  mutations:{
    changeNetwork : function(){
      tip('请求错误 请检查网络！！');
    }
  },
  plugins: [createPersistedState({
    storage: window.sessionStorage
  })]
});
